<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="renderer" content="webkit"/>
  <meta name="force-rendering" content="webkit"/>
  <title>Dark/Light Mode Toggle</title>
  <style>
    body {
      height: 100vh;
      display: flex;
      justify-content: center;
      margin-top: 300px;
      background-color: #fff;
      overflow: hidden;
    }

    .credit {
      position: fixed;
      right: 2rem;
      bottom: 2rem;
      color: white;
    }

    .credit a {
      color: inherit;
    }

    .main-circle {
      width: 50rem;
      height: 50rem;
      border-radius: 10px;
      background: linear-gradient(40deg, #FF0080, #FF8C00 70%);
      position: absolute;
      z-index: 1;
      left: 50%;
      transform: translate(-50%, -70%);
    }

    .phone {
      position: relative;
      z-index: 2;
      width: 18rem;
      height: 17rem;
      background-color: inherit;
      box-shadow: 0 4px 35px rgba(0, 0, 0, 0.1);
      border-radius: 10px;
      display: flex;
      flex-direction: column;
    }

    .menu {
      font-size: 80%;
      opacity: 0.4;
      padding: 0.8rem 1.8rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .icons {
      display: flex;
      margin-top: 0.5rem;
    }

    .battery {
      width: 0.85rem;
      height: 0.45rem;
      background-color: black;
    }

    .network {
      width: 0;
      height: 0;
      border-style: solid;
      border-width: 0 6.8px 7.2px 6.8px;
      border-color: transparent transparent black transparent;
      transform: rotate(135deg);
      margin: 0.12rem 0.5rem;
    }

    .content {
      display: flex;
      flex-direction: column;
      margin: auto;
      text-align: center;
      width: 70%;
      transform: translateY(5%);
    }

    .circle {
      position: relative;
      border-radius: 100%;
      width: 8rem;
      height: 8rem;
      background: linear-gradient(40deg, #FF0080, #FF8C00 70%);
      margin: auto;
    }

    .crescent {
      position: absolute;
      border-radius: 100%;
      right: 0;
      width: 6rem;
      height: 6rem;
      background: white;
      transform: scale(0);
      transform-origin: top right;
      transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
    }

    label, .toggle {
      height: 2.8rem;
      border-radius: 100px;
    }

    label {
      width: 100%;
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 100px;
      position: relative;
      margin: 1.8rem 0 4rem 0;
      cursor: pointer;
    }

    .toggle {
      position: absolute;
      width: 50%;
      background-color: #fff;
      box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
      transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .names {
      font-size: 90%;
      font-weight: bolder;
      color: black;
      width: 65%;
      margin-left: 17.5%;
      margin-top: 0;
      position: absolute;
      display: flex;
      justify-content: space-between;
      user-select: none;
    }

    .dark {
      opacity: 0.5;
    }

    .mark {
      border-radius: 100px;
      background-color: black;
    }

    .time {
      color: black;
    }

    [type="checkbox"] {
      display: none;
    }

    [type="checkbox"]:checked + .app .toggle {
      transform: translateX(100%);
      background-color: #34323D;
    }

    [type="checkbox"]:checked + .app .dark {
      opacity: 1;
      color: white;
    }

    [type="checkbox"]:checked + .app .body {
      background-color: #26242E;
      color: white;
      border-radius: 40px;
    }

    [type="checkbox"]:checked + .app .crescent {
      transform: scale(1);
      background: #26242E;
    }

    [type="checkbox"]:checked + .app .circle {
      background: linear-gradient(40deg, #8983F7, #A3DAFB 70%);
    }

    [type="checkbox"]:checked + .app .main-circle {
      background: linear-gradient(40deg, #8983F7, #A3DAFB 70%);
    }

    [type="checkbox"]:checked + .app .time {
      color: white;
    }

    [type="checkbox"]:checked + .app .phone .menu .icons .network {
      border-color: transparent transparent white transparent;
    }

    [type="checkbox"]:checked + .app .phone .menu .icons .battery {
      background-color: white;
    }
  </style>
</head>
<body>
  <input id="switch" type="checkbox" aria-label="Toggle Dark/Light Mode">
  <div class="app">
    <div class="body">
      <div class="phone">
        <div class="menu">
          <div class="time">5:20</div>
          <div class="icons">
            <div class="network"></div>
            <div class="battery"></div>
          </div>
        </div>
        <div class="content">
          <div class="circle">
            <div class="crescent"></div>
          </div>
          <label for="switch">
            <div class="toggle"></div>
            <div class="names">
              <p class="light">太阳</p>
              <p class="dark">月亮</p>
            </div>
          </label>
        </div>
      </div>
    </div>
  </div>
</body>
</html>
